<?php

/**
 * OntoWiki similarinstances module template
 */

?>
<?php if (!empty($this->similars)): ?>
	<ul class="bullets-none separated">
	    <?php foreach ($this->similars as $type => $instances): ?>
            <?php $class = $this->types[$type] ?>
	        <li class="has-contextmenu-area">
                <strong>
                    <a class="hasMenu"
                       about="<?php echo $class['uri'] ?>"
                       href="<?php echo $class['url'] ?>"><?php echo $class['title'] ?></a>
                </strong>
	            <ul class="inline separated" style="padding-left: 0.5em;">
	                <?php $i = 0; ?>
	                <?php foreach ($instances as $instance): ?>
	                    <?php if ((++$i == count($instances)) && ($class['has_more'] == false) ): ?>
	                        <li class="last-child"><a class="hasMenu" about="<?php echo $instance['uri'] ?>" href="<?php echo $instance['url'] ?>"><?php echo $instance['title'] ?></a></li>
	                    <?php else: ?>
	                        <li><a class="hasMenu" about="<?php echo $instance['uri'] ?>" href="<?php echo $instance['url'] ?>"><?php echo $instance['title'] ?></a></li>
	                    <?php endif; ?>
                    <?php endforeach; ?>
                    <?php if ($class['has_more'] == true): ?>
                            <li>&hellip;</li>
                    <?php endif; ?>
	            </ul>
                    <div class="contextmenu">
                        <a class="item"
                           href="<?php echo $class['listUrl'] ?>">
                            <span class="icon icon-list" title="Show as List">
                                <span>Show as List</span>
                            </span>
                        </a>
                    </div>
	        </li>
	    <?php endforeach; ?>
	</ul>
<?php else: ?>
	<p class="messagebox info"><?php echo $this->_($this->message) ?></p>
<?php endif; ?>
